package com.xishu.entity;

import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Objects;

public class NameAndId implements Serializable {
    private static final long serialVersionUID = -3136819650536467330L;

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "对应的名称")
    private String name;

    @ApiModelProperty(value = "对应的名称")
    private String name_zh;

    @ApiModelProperty(value = "对应的名称")
    private String name_en;

    @ApiModelProperty(value = "是否选中")
    @Transient
    private boolean select;

    public String getName_zh() {
        return name_zh;
    }

    public void setName_zh(String name_zh) {
        this.name_zh = name_zh;
    }

    public String getName_en() {
        return name_en;
    }

    public void setName_en(String name_en) {
        this.name_en = name_en;
    }

    public NameAndId() {
    }

    public NameAndId(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public boolean isSelect() {
        return select;
    }

    public void setSelect(boolean select) {
        this.select = select;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("NameAndId{");
        sb.append("id=").append(id);
        sb.append(", name='").append(name).append('\'');
        sb.append(", select=").append(select);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof NameAndId)) return false;
        NameAndId nameAndId = (NameAndId) o;
        return Objects.equals(id, nameAndId.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
